home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
pasprog.EXE
/
DISASDEN.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1980-01-10
|
3KB
|
123 lines
program disasden;
{
(c)1995 GoRGoN ltd.
Demonstrates unit DISAS386
}
uses disas386;
procedure DisasMe(x:pointer);
begin
byte(x):=1;
word(x):=2;
x:=pointer($ABCD1234);
asm
mov ax,word(x)
db 66h{operand size prefix}
mov ax,word(x);
{all 386 instructions supported}
db 66h;mov cx,ax
db 66h;lea si,[bx+di+$123]
db 0d4h {AAM}
db 0ah
db 0d4h {Undocumented feature of AAM not supported!}
db 05h
db 0,0
db 0fh;db 05h;{loadall}
db 0fh;db 0bah;db 45 {bts}
db 0,0,0,0,0,0,0
end;
end;
begin
WriteLn('20 Lines Disassembly of procedure DisasMe');
WriteLn('────────────────────────────────────────────');
disasptr(@DisasMe,20);
WriteLn('Press any key to continue');
asm xor ax,ax;int 16h;end;
FullDisas:=False;
WriteLn;
WriteLn('Now FullDisas is ',FullDisas);
WriteLn('────────────────────────────────────────────');
disasptr(@DisasMe,20);
WriteLn('Press any key to continue');
asm xor ax,ax;int 16h;end;
FullDisas:=TRUE;
WriteLn;
WriteLn('Now FullDisas is ',FullDisas,', Clipping to 35 chars');
WriteLn('────────────────────────────────────────────');
disasptrl(@DisasMe,20,35);
WriteLn;
WriteLn('Press any key to continue');
asm xor ax,ax;int 16h;end;
WriteLn;
WriteLn('Press any key to Disassembly Line by Line (5 more lines)');
WriteLn('────────────────────────────────────────────');
Disas(Seg(DisasMe),Ofs(DisasMe));
WriteLn(' ',dStr);
asm xor ax,ax;int 16h;end;
DisasNext;
WriteLn(' 1 ',dStr);
asm xor ax,ax;int 16h;end;
DisasNext;
WriteLn(' 2 ',dStr);
asm xor ax,ax;int 16h;end;
DisasNext;
WriteLn(' 3 ',dStr);
asm xor ax,ax;int 16h;end;
DisasNext;
WriteLn(' 4 ',dStr);
asm xor ax,ax;int 16h;end;
DisasNext;
WriteLn(' 5 ',dStr);
WriteLn;
WriteLn('Press any key to Disassembly same instruction once more');
WriteLn('────────────────────────────────────────────');
asm xor ax,ax;int 16h;end;
io:=oldio;
DisasNext;
WriteLn(' ',dStr);
WriteLn;
WriteLn('is = "',hxw(is),'h"');
WriteLn('io = "',hxw(io),'h"');
WriteLn('inst = "',inst,'"');
WriteLn('pist = "',pist,'"');
WriteLn('list = "',list,'"');
WriteLn('o1st = "',o1st,'"');
WriteLn('o2st = "',o2st,'"');
WriteLn;
WriteLn('Press any key to exit');
asm xor ax,ax;int 16h;end;
end.